well. Removing the non-compulsory “0× ”, we could write this logic in
bytecode as “6060”.
Going a bit further,
PUSH1 0×60 PUSH1 0×40 MSTORE The MSTORE (0× 5 2) takes in 2 inputs
and produces no output.
The meaning of opcodes used above is as follows:
PUSH1 (0×60): In the stackput 0× 60.
PUSH1 (0×40): In the stackput 0× 40.
MSTORE (0×52): Allocate 0× 60 of memory space and move to the 0× 40
position.
The resulting bytecode is: 606060405 2
At the beginning of any solidity bytecode, we always see this magic number
“606060405 2” because this is how the smart contract bootstraps, and to
further complicate the matter, 0× 40 or 0× 60 cannot be interpreted as the
real number 40 or 60. Being hexadecimal, 40 actually equates to 64 (16¹ ×
4), and 60 equates to 9 6 (16¹ × 6) in decimal. What “PU SH1 0× 60 PU SH1
0× 40 MSTORE” does is it allocates 9 6 bytes of memory and moves the
pointer to the beginning of the 64th byte, which means that we now have 64
bytes for scratch space and 3 2 bytes for temporary memory storage. To
store data in the EVM, we have three places. The first is the stack, where
we have j ust used the PU SH opcode to store data there as per the example
above, the second is the memory (RAM) where we use the MSTORE
opcode, and the third is the disk storage where we use SSTORE to store the
data. It is the most expensive for the gas required to store data to storage,
and it is the cheapest to store data to the stack.
Token
A smart contract living on the Ethereum blockchain having many uses and
purposes is the token that can fulfill many roles in its native ecosystem and
is not limited to one particular role.
The roles that tokens can take are: In order to access the dApp a token can
act as a gateway, and you need to hold the tokens, i.e., it acts as the toll. The
token qualifies its holder to have voting rights. When thinking of EOS,
holding EOS token allows you to vote for block producers. To become a